export {};

class demo1 {
    id: number = 1;
    name: string;
    age: number;

    // 构造器必须带 name, age
    constructor(name: string, age: number) {
        this.name = name;
        this.age = age;
    }

    infoStr(): string {
        return `name:${this.name}, age: ${this.age}`;
    }
}

let obj = new demo1("xue", 1);
console.log(obj.infoStr());
